<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <title>协议编辑</title>
    <#include "/view/admin/head.html"/>
    
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
    <script type="text/javascript" src="${base}/jstool/bootstrap-select/js/bootstrap-select.min.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-select/lang/defaults-zh_CN.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-select/css/bootstrap-select.min.css" />    


	
	<link rel="stylesheet" href="${base}/clause/assets/design/css/trumbowyg.css">
	<script src="${base}/clause/assets/jquery.min.js"></script>
	<script src="${base}/clause/assets/trumbowyg.js"></script>
	<script src="${base}/clause/assets/plugins/base64/trumbowyg.base64.js"></script>	
	
    <style type="text/css">
        .list-path{
            height: 50px;
            line-height: 50px;
            background-color: #9acfea;

        }
        .table-class{
            width:80%;
            text-align: center;
            border:1px solid #afd9ee;
            margin:0 auto;
            margin-top: 50px;
        }
        table th{
            width:20%;
            background-color: #d9edf7;
            text-align: right;
        }
        table td{
            width:20%;
            text-align: left;
        }
        .go-back{
            float:right;
            margin-right: 30px;

        }
    </style>
   
    
</head>
<body>

<div class="list-path" > <span style="margin-left: 50px;"><span class="glyphicon glyphicon-home"></span> 协议编辑</span></div>
    <div style="float:right;margin-right: 40px;"><a class="btn btn-info" href="${base}/clause/tclauseList.do">返回上一级</a></div>
</div>


<div class="table-class">       
      <#if  message?? &&  message =="1" >
        <div class="alert alert-error" style="background-color: write;color: green;">           
           <font size="5"><strong>发布成功</strong></font>
        </div>
     </#if>
      <#if  message?? &&  message =="0" >
        <div class="alert alert-error" style="background-color: write;color: red;">           
           <font size="5"><strong>取消发布</strong></font>
        </div>
     </#if>
      <#if  message?? &&  message =="2" >
        <div class="alert alert-error" style="background-color: write;color: green;">           
           <font size="5"><strong>保存成功</strong></font>
        </div>
     </#if>     
      
    <table class="table table-bordered">
        <thead>

        </thead>
        <tbody>
          <form  action="${base}/season/tclauseSave.do?clauseId=${tclause.clauseId!}" method="post" enctype="multipart/form-data"   id="myform" >
              <tr>
                <th>协议：</th>
                <td>
                <select name="type"  id="type"  >
                   <option value="0"    <#if tclause.type?? && tclause.type ==0 > selected ="selected"</#if> >服务条款</option>
                   <option value="1"    <#if tclause.type?? && tclause.type ==1 > selected ="selected"</#if> >关于社聚</option>   
                   <option value="2"    <#if tclause.type?? && tclause.type ==2 > selected ="selected"</#if> >客服中心</option>                  
                </select>                                             
                </td>
                <th></th>
                <td>               
                </td>
              </tr>                             
              <tr>   	               
<div id="odiv" style="display:none;position:absolute;z-index:100;">
    <img src="assets/pic/sx.png" title="缩小" border="0" alt="缩小" onclick="sub(-1);"/>
    <img src="assets/pic/fd.png" title="放大" border="0" alt="放大" onclick="sub(1)"/>
    <img src="assets/pic/cz.png" title="重置" border="0" alt="重置" onclick="sub(0)"/>
    <img src="assets/pic/sc.png" title="删除" border="0" alt="删除" onclick="del();odiv.style.display='none';"/>
</div>
<div  onmousedown="show_element(event)" style="clear:both" id="customized-buttonpane" class="editor">${tclause.content!}</div> 


              </tr>           
                           
     </form>   

       <tr>
            <td colspan="4" width="100%" style="text-align: center;">

                <a class="btn btn-success  approve-btn btn-approve" href="javascript:submitVoteOrder()">&nbsp;提交&nbsp;</a>
                <span >&nbsp;</span> 
            </td>
        </tr>
               
        </tbody>
    </table>

</div>

<script type="text/javascript">
   

  //提交图片
  function submitVoteOrder(){
	 // alert(111);
	  var type = $("#type").val();
	 
 	  var abc = $("#customized-buttonpane").html();	 	   
	    $.ajax({  
	        type : "post",  //提交方式  
	        url : "tclauseSave.do?clauseId=${tclause.clauseId!}",//路径  
	        async: false,
	        data : "&type="+type+"&content="+abc,//数据，这里使用的是Json格式进行传输      
	        dataType: "json",
	        success : function(result) {//返回数据根据结果进行相应的处理  
	               	       
	        }
	    }); 
	    window.location.href="tclauseList.do";  	  	  	  	  	  	 
  }
  
  
  function weather(){
	  
	    $.ajax({  
	        type : "get",  //提交方式  
	        url : "http://v.juhe.cn/weather/index",//路径  
	        async: false,
	        data : "cityname=%E5%B9%BF%E5%B7%9E&dtype=&format=&key=2c5e51150c7bca1d83ba8dc0e21b5209",//数据，这里使用的是Json格式进行传输      
	        dataType: "json",
	        success : function(result) {//返回数据根据结果进行相应的处理  
	        //var message =eval(result);
	        console.log(result);
	       console.log(result.msg);	
	        var result11 = result.result;
	        if(result11 == 0){
	        	alert("图片顺序不能重复");
	        	return false;
	        }else{
	        	
	         document.getElementById("myform").submit(); 
	        }
	       
	       
	        }
	    }); 
  }

  function isInteger(obj) {
	   return obj%1 === 0
	  }
	  isInteger(3) // true
	  isInteger(3.3) // false　 
  
  
	  $(function() {
		    //初始化
		        $('#validDate').datetimepicker(
						{
							language : 'zh-CN',//显示中文
							format : "yyyy-mm-dd",
							autoclose : true,
							todayBtn : true,
							startDate : "<#if (beginTime)??></#if>",
							minuteStep : 10,
							minView: "month"
						});
		});	  
	  
</script>



</body>
</html>